﻿namespace VkApi
{
    public class VkAttachment
    {
        public VkAttachmentType Type { get; set; }
        public VkAttachmentBase AttachmentObject { get; set; }

        public static VkAttachmentType ParseType(string input)
        {
            VkAttachmentType result;
            switch (input)
            {
                case "photo":
                case "posted_photo":
                    result = VkAttachmentType.Photo;
                    break;
                case "video":
                    result = VkAttachmentType.Video;
                    break;
                case "audio":
                    result = VkAttachmentType.Audio;
                    break;
                case "link":
                    result = VkAttachmentType.Link;
                    break;
                default:
                    result = VkAttachmentType.Photo;
                    break;
            }

            return result;
        }
    }
}
